package com.patterns;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Cache implements Serializable{

	private static final long serialVersionUID = 1L;
	
	Map<String,Object> masterCache;
	
	public Cache(){
		masterCache = new HashMap<>();		
	}

	private Cache(Map<String,Object> map){
		masterCache = map;
	}
	
	public void putInCache(String s, Object o) {
		masterCache.put(s, o);
	}
	
	public Cache getCopy(){
		return new Cache(this.masterCache);
	}

	@Override
	public String toString() {
		return masterCache.toString();
	}
	
	
}
